#ifndef _PLAYER_H
#define _PLAYER_H

#include "prop.h"
#include "monster.h"
#include "Scene.h"

#include <DynamicArray.h>
// #include <mystring.h>

#define DAMAGE(a,b) ((a->attack)-(b->def))

struct Player
{
    int HPMax;
    int HP;
    int MP;
    int attack;
    int def;
    int x;
    int y;
    int exp;
    int level;
    int spt;
    int gold;
    char symbol[10];
   
    defence armor;
    weapon  wpn;
    medicament item;
    DArray bag;

};

typedef struct Player player;

void InitPlayer(player* p);

void PlayerMove(char* (*map)[MAPSIZE],player* p,DArray* ms);

void PrintPlayerStatus(player* p);

void LevelUp(player* p);

void ShopInterFace(player* p);

void ShowBag(player* p);

void WeaponUse(player* p);

void ArmorUse(player* p);

void ItemUse(player* p);

void MPAttack(player* p,monster* m);

mystr PlayerToString(player* p);

void StringToPlayer(mystrlist* ply,player* p);

void PuseInterface(player* p,DArray* ms,char* (*map)[MAPSIZE]);

int WeaponEffect(player* p,monster* m);

int ArmorEffect(player* p,monster* m);

bool LoadGame(player* p,DArray* m);

#endif